import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
//import {
//  trigger,
//  state,
//  style,
//  animate,
//  transition
//} from '@angular/animations';

@Component({
  selector: 'app-auth-sign-in',
  templateUrl: './auth-sign-in.component.html',
  styleUrls: ['./auth-sign-in.component.scss'],
  //animations: [
  //  trigger('flyInOut', [
  //    transition('void => *', [
  //      style({
  //        opacity: 0,
  //        transform: 'translateX(-100%)'
  //      }),
  //      animate('0.2s ease-in')
  //    ]),
  //    transition('* => void', [
  //      animate('0.2s 10 ease-out', style({
  //        opacity: 0,
  //        transform: 'translateX(100%)'
  //      }))
  //    ])
  //  ])
  //]
})
export class AuthSignInComponent implements OnInit {

  private from: string = '/';

  email: string = '';

  constructor(
    private route: ActivatedRoute,
    private router:Router
  ) {

  }

  ngOnInit() {
    this.route.params.subscribe((params) => {
      this.email = params.email;
      this.from = params.from || this.from;
    });
  }

  logined (data) {
    this.router.navigateByUrl(this.from);
  }

}
